﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Player : Father
    {
        enum Fist
        {
            石头 = 1,
            剪刀,
            布,
        }


        public Player(string name) : base(name)
        {
            this.Name = name;
        }


        public int punch()
        {
            Console.WriteLine("请出拳：{0}(请输入相应的数字)", ListFist());
            int choose = int.Parse(Console.ReadLine());
            Fist f = (Fist)choose;
            Console.WriteLine("{0},出拳：{1}", base.Name, f);
            return choose;
        }
        static string ListFist()
        {
            string fistString = " ";
            int i = 1;
            foreach (Fist f in Enum.GetValues(typeof(Fist)))
            {
                fistString += i + "、" + f + "；";
                i++;
            }
            return fistString;
        }
    }
}
